package com.platform.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import com.platform.dao.FarmChapterMapper;
import com.platform.entity.FarmChapterEntity;
import com.platform.service.FarmChapterService;

/**
 * 章节表二级Service实现类
 *
 * @author lipengjun
 * @email 939961241@qq.com
 * @date 2020-02-10 22:01:14
 */
@Service("farmChapterService")
public class FarmChapterService{
    @Autowired
    private FarmChapterMapper farmChapterMapper;

   /**
    * 根据parentId查找
    * @param id
    * @return
    */
    public List<FarmChapterEntity> findByParentId(Integer id){
    	return farmChapterMapper.findByParentId(id);
    }
    
    public FarmChapterEntity queryObject(Integer id) {
        return farmChapterMapper.selectByPrimaryKey(id);
    }

    
    public List<FarmChapterEntity> queryList(Map<String, Object> map) {
        return farmChapterMapper.queryList(map);
    }

    
    public int queryTotal(Map<String, Object> map) {
        return farmChapterMapper.queryTotal(map);
    }

    
    public int save(FarmChapterEntity farmChapter) {
        return farmChapterMapper.insertSelective(farmChapter);
    }

    
    public int update(FarmChapterEntity farmChapter) {
        return farmChapterMapper.updateByPrimaryKeySelective(farmChapter);
    }

    
    public int delete(Integer id) {
        return farmChapterMapper.deleteByPrimaryKey(id);
    }

    
    public int deleteBatch(Integer[] ids) {
        return farmChapterMapper.deleteBatch(ids);
    }
    
    
}
